package com.binhthuan.catechist.client.viewer;

import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.data.DateDS;
import com.binhthuan.catechist.shared.constant.Parameter;
import com.smartgwt.client.widgets.viewer.DetailViewerField;

public class DateViewer extends AbstractViewer {

    public DateViewer(DateDS dataSource) {
        super(dataSource);

        DetailViewerField header = new DetailViewerField();
        header.setType(HEADER);
        header.setValue(ECApplication.getConstants().schoolDateInformation());

        DetailViewerField dateField = new DetailViewerField(Parameter.DATE_OF_YEAR);
        dateField.setTitle(ECApplication.getConstants().date());

        DetailViewerField liturgicalDateField = new DetailViewerField(Parameter.LITURGICAL_DATE);
        liturgicalDateField.setTitle(ECApplication.getConstants().liturgicalDate());

        setFields(header, dateField, liturgicalDateField);
    }
}
